//
//  MVCollectionViewCell.m
//  QQMusic_MV
//
//  Created by dllo on 16/8/15.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "MVCollectionViewCell.h"
#import "MvlistModel.h"
#import "UIImageView+WebCache.h"
@interface MVCollectionViewCell ()
@property (strong, nonatomic) IBOutlet UIImageView *picImageView;
@property (strong, nonatomic) IBOutlet UILabel *musicName;
@property (strong, nonatomic) IBOutlet UILabel *descriptionLabel;


@end

@implementation MVCollectionViewCell

// 重写 set方法 给collectionVIew赋值
- (void)setMvlist:(MvlistModel *)mvlist {
    _mvlist = mvlist;
    NSString *songAndSinger = [mvlist.mvtitle stringByAppendingFormat:@" - %@", mvlist.singername];
    _musicName.text = songAndSinger;
    _descriptionLabel.text = mvlist.mvdesc;
    if (mvlist.picurl.length != 0) {
        [_picImageView sd_setImageWithURL:[NSURL URLWithString:mvlist.picurl]];
    } else {
        NSString *str = [NSString stringWithFormat:@"http://shp.qpic.cn/qqvideo_ori/0/%@_360_204/0?max_age=259200", mvlist.vid];
        [_picImageView sd_setImageWithURL:[NSURL URLWithString:str]];
    }
}

@end
